package cn.uniqueinfo.dp.filter;

import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.web.filter.authz.AuthorizationFilter;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

/**
 * @author:朱元勋
 * @mail:395910063@qq.com
 * @date:2019-01-09 11:44:59
 * @description:
 */
@Slf4j
public class ShiroPermFilter extends AuthorizationFilter {
    @Override
    protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) throws Exception {
        Subject subject = getSubject(request, response);
        String[] permsArray = (String[]) mappedValue;
        log.warn("获取权限:"+permsArray.toString());
        return false;
    }
}
